home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 47.7z / BS1 part 47 / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 6 of 7)[HD].7z / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 6 of 7)[HD].adf / piarc.lzh.parta / iraw.rexx < prev    next >
OS/2 REXX Batch file  |  1994-03-17  |  3KB  |  147 lines

  1. /*
  2.  * IRAW.rexx   - I-raw is a 'chunky' graphics format used on
  3.  *               DEC VAX platforms, and as an interchange image format
  4.  *               between VAX graphics and Intel based machines.
  5.  *
  6.  *  Written by: Barry Chalmers
  7.  * Last Update: March 25th, 1993
  8.  *    Revision: 1.02
  9.  *         For: Black Belt Systems image processing series IM, IM F/c, and IP.
  10.  * ---------------------------------------------------------------------------
  11.  *    Revision: 1.01 - see ReadMe file for details on changes to this level
  12.  *
  13.  *        1.02  25 Mar 1993  (BC)  Did not report on insufficient memory for
  14.  *                                 new buffer from IM prior to 9.51
  15.  */
  16. parse arg action '"' filename '"' buffer
  17. call pragma('stack',20000);
  18. /*
  19.  * open rexxsupport.library -- needed for some functions
  20.  */
  21. if ~show('L',"rexxsupport.library") then do
  22.   if addlib('rexxsupport.library',0,-30,0) then do
  23.       /* everything's ok */
  24.     end;
  25.   else do
  26.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  27.     say 'Cannot operate  without this library - sorry!';
  28.     exit 10;
  29.     end;
  30.   end;
  31.  
  32.  
  33.   /*
  34.    * This code attempts to read a file called "picmdpath" from REXX:
  35.    * If it can't find it, the script will assume that the commands
  36.    * associated with this PI Module are in "c:". If the file exists,
  37.    * the script will look in the path that is specified in the file.
  38.    * If you create this file, you MUST put a complete, correct path
  39.    * in it; if the commands are in a sub-directory, you have to put
  40.    * the trailing slash on the path (like, device:dir/).
  41.    * 
  42.    */
  43.   cmdpath = 'c:';
  44.   if open(fhandle,'rexx:picmdpath','read') then  /* open the file */
  45.     do
  46.       cmdpath = readln(fhandle);
  47.       call close(fhandle);  /* close the file    */
  48.     end
  49.  
  50. prtnme = 'IM_Port';
  51. address(prtnme);
  52.  
  53. if action = 'load' then do
  54.   pick = 1;
  55.   end
  56. else if action = 'save' then do
  57.   pick = 2;
  58.   end
  59. else do
  60.   options results;
  61.   'gadgets "Load","I-raw","Save","I-raw"';
  62.   pick = result;
  63.   options;
  64.   end;
  65.  
  66. if pick=0 then do
  67.   exit 0;
  68.   end;
  69.  
  70. path = 'ram:';
  71. name = '';
  72. ext  = '';
  73.  
  74. if pick = 1 then do
  75.   options results;
  76.   'filerequest "'||path||'","'||name||'","'||ext||'","Load I-raw"';
  77.   irawfile = result;
  78.   options;
  79.  
  80.   if irawfile = 'FR_CANCELLED' then do
  81.     address(prtnme);
  82.     'imtofront';
  83.     exit 0;
  84.     end;
  85.  
  86.   address(prtnme);
  87.   options results;
  88.   'jackin';
  89.   jackadr = result;
  90.   options;
  91.  
  92.   
  93.   address(prtnme);
  94.   options results;
  95.   'jackin';
  96.   jackadr = result;
  97.   options;
  98.  
  99.   address command cmdpath||'iraw '||jackadr||' 0 '||irawfile;
  100.   address(prtnme);
  101.   'redraw'
  102.   
  103.     exit 0;
  104.   end;
  105. if pick = 2 then do
  106.  
  107.   if filename = '' then do
  108.      options results;
  109.      'filerequest "'||path||'","'||name||'","'||ext||'","Save I-raw"';
  110.      irawfile = result;
  111.      options;
  112.      end;
  113.   else do
  114.      irawfile = filename;
  115.      end;
  116.  
  117.   if irawfile = 'FR_CANCELLED' then do
  118.     address(prtnme);
  119.     'imtofront';
  120.     exit 0;
  121.     end;
  122.  
  123.   address(prtnme);
  124.   if buffer = '' then do
  125.       options results;
  126.       'jackin';
  127.       jackadr = result;
  128.       options;
  129.       end;
  130.   else do
  131.       options results;
  132.       'backin '||buffer;
  133.       jackadr = result;
  134.       options;
  135.       end;
  136.  
  137.   address command cmdpath||'iraw '||jackadr||' 1 "'||irawfile||'"';
  138.   address(prtnme);
  139.   'finish';
  140.  
  141.     exit 0;
  142.   end;
  143. exit 0;
  144. end;
  145.  
  146. /* The end */
  147.